#pragma once
#include <stdint.h>
#include <iostream>
#include <fstream>

#define CYCLE_TIME 600

using namespace std;

static unsigned char* read_file(char* filename) {
	ifstream _stream (filename, ios::in | ios::binary | ios::ate);
	if(!_stream.is_open()) {
		cout << "Error opening file " << filename << ".\n";
		return 0;
	}

	int size = (int)_stream.tellg();
	unsigned char* buffer = new unsigned char[size];
	_stream.seekg(0);
	_stream.read((char*)buffer, sizeof(size));
	_stream.close();
	return buffer;
}